home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
hash.zip
/
LIST.4
< prev
next >
Wrap
Text File
|
1993-01-04
|
592b
|
24 lines
;--------------------------------------------
;HASH--Procedure to hash a four byte string
;
; Input: AX := first two bytes of string
; BX := second two bytes of string
;
; Output: AL := hash value (0-60)
;
; Registers destroyed: AX,BX
;---------------------------------------------
;
TAB_sz equ 61 ;define table size
hash proc near
push dx ;save DX
xor ax,bx ;combine into 16 bits
xor dx,dx ;clear DX-dividend in DX AX
mov bx,TAB_sz ;table size to BX
div bx ;divide-remainder is in DX
mov ax,dx ;remainder to AX
pop dx ;restore DX
ret
hash endp